package com.dailyblue.java.cloud.customer.controller;

import com.dailyblue.java.cloud.commons.util.JsonResult;
import com.dailyblue.java.cloud.customer.service.BasicService;
import com.dailyblue.java.cloud.customer.service.RibbonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/customer")
public class CustomerController {
    @Resource
    private BasicService basicService;
    @Resource
    private RibbonService ribbonService;

    @GetMapping("/a")
    public JsonResult a() {
        log.info("访问了ribbon的a");
        return basicService.a();
    }

    @GetMapping("/basic")
    public JsonResult basic() {
        return basicService.a();
    }

    @GetMapping("/ribbon")
    public JsonResult ribbon() {
        return ribbonService.a();
    }
}
